Universal Block Opener
Pluto allows do
to be used as a universal block opener, meaning it can be used instead of then
and begin
.
If Statement Examplepluto
local x = 3if x == 3 doprint("x is 3!")end
Class Statement Examplepluto
class Human dofunction __construct(public name) endfunction greet() print($"Hello, {self.name}!") endendnew Human("John"):greet()
Enum Statement Examplepluto
enum Suit doHEARTS,DIAMONDS,CLUBS,SPADESendassert(HEARTS == 1)